import java.io.*;

public class fizzbuzz {
    
    public static void printFizzBuzz (int A, int B, int n){
        String output = "";
        boolean flag1, flag2;
        for (int i = 1;i<n+1;i++){
            flag1 = false;
            flag2 = false;
            if (i%A == 0) flag1 = true;
            if (i%B == 0) flag2 = true;
            if (flag1 && flag2) output = output.concat("FB ");
            if (flag1 && !flag2) output = output.concat("F ");
            if (!flag1 && flag2) output = output.concat("B ");
            if (!flag1 && !flag2) output = output.concat(i+" ");
            
        }
        System.out.println(output);
    }
    
    public static void main (String[] args) throws IOException {
        if (args.length <1) throw new RuntimeException("not enough arguments");
        else if (args.length>1) throw new RuntimeException ("too many arguments");
        else {
        final BufferedReader reader = new BufferedReader(new FileReader(new File(args[0])));
        String line;
        while ((line = reader.readLine()) != null){
            //parse arguments
            String[] fizzBuzzArgs = line.split("\\s");
            //call printFizzBuzz with arguments
            try{
                int A = Integer.parseInt(fizzBuzzArgs[0]);
                int B = Integer.parseInt(fizzBuzzArgs[1]);
                int n = Integer.parseInt(fizzBuzzArgs[2]);
                printFizzBuzz (A,B,n);
            }catch (NumberFormatException e) {
                throw new RuntimeException (" file contains non numeric values");
            }
            
        }
        }     
    }
}